/**
 * Handle changed data.
 *
 * @param {Object} oldValue old value
 * @param {Object} newValue new value
 * @param {JSEvent} event the event that triggered the action
 *
 * @returns {Boolean}
 *
 * @properties={typeid:24,uuid:"FB386406-00B7-4961-BDEA-548435C68D99"}
 */
function onDataChangeImg(oldValue, newValue, event) {
	if (newValue == 0)
		imagen = null
	elements.fld_img.visible = newValue
	marca_imagen = newValue
	return true
}

/**
 * Handle record selected.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"19E68C23-104F-4D08-9A8B-9D5C67977B27"}
 */
function onRecordSelection(event) {
	elements.fld_img.visible = marca_imagen
}

/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"14C19BC8-F55B-419E-945A-9E470E42DB1B"}
 */
function aceptar(event) {
	//databaseManager.saveData(foundset.getRecord(foundset.getSelectedIndex()))
	application.closeFormDialog('FIDTL')
}

/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"6BC82894-FEF1-4E60-A6E6-3A08CAB97CC1"}
 */
function cancelar(event) {
	controller.deleteRecord()
	application.closeFormDialog('FIDTL')
}

/**
 * @properties={typeid:24,uuid:"DD5AD7F4-DD56-464F-8641-B979CB1C0A97"}
 */
function muestraResultado()
{
	var $tRes = ficha_detalle_to_estudios.tipo_resultado
	if ($tRes == 1)
	{
		elements.fld_num.enabled 	= 1
		elements.fld_txt.enabled 	= 0
		elements.fld_vl.enabled 	= 0
	}
	else
		if ($tRes == 2)
		{
			elements.fld_num.enabled 	= 0
			elements.fld_txt.enabled 	= 1
			elements.fld_vl.enabled 	= 0
		}
		else
		{
			elements.fld_num.enabled 	= 0
			elements.fld_txt.enabled 	= 0
			elements.fld_vl.enabled 	= 1
		}
}

/**
 * Callback method for when form is shown.
 *
 * @param {Boolean} firstShow form is shown first time after load
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"112AA2EE-CCA6-4F31-87DC-F71E5A4DEFEA"}
 */
function onShow(firstShow, event) {
	elements.fld_num.enabled 	= 0
	elements.fld_txt.enabled 	= 0
	elements.fld_vl.enabled 	= 0
}
